Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Allow fallback to AWQ from AWQMarlin at per-layer granularity #13119

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

mgoin
Copy link
Member

@mgoin mgoin commented Feb 11, 2025

Models like TechxGenus/DeepSeek-Coder-V2-Lite-Instruct-AWQ have some layers that can't satisfy the constraints of marlin even for TP=1.

[rank0]: ValueError: Weight input_size_per_partition = 10944 is not divisible by min_thread_k = 128. Consider reducing tensor_parallel_size or running with --quantization awq.

This PR makes it so we check if the layer shapes are compatible with the marlin kernel and routes to the unoptimized kernel as a last effort to support that layer.

Tested with lm-eval

lm_eval --model vllm --model_args pretrained=TechxGenus/DeepSeek-Coder-V2-Lite-Instruct-AWQ --trust_remote_code --tasks gsm8k --num_fewshot 5 --batch_size auto
...
WARNING 02-11 22:26:57 awq_marlin.py:131] Layer 'model.layers.0.mlp.down_proj' is not supported by AWQMarlin. Falling back to unoptimized AWQ kernels.
...
vllm (pretrained=TechxGenus/DeepSeek-Coder-V2-Lite-Instruct-AWQ,trust_remote_code=True), gen_kwargs: (None), limit: None, num_fewshot: 5, batch_size: auto
|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.7111|±  |0.0125|
|     |       |strict-match    |     5|exact_match|↑  |0.6816|±  |0.0128|

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Signed-off-by: mgoin <[email protected]>
@mgoin mgoin added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 12, 2025
@jeejeelee jeejeelee enabled auto-merge (squash) February 12, 2025 15:32
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file just make it such that we always have

self.input_size_per_partition
self.output_size_per_partition
self.output_partition_sizes

defined for layers before calling quant_config.get_quant_method() so we can check these there

@simon-mo simon-mo merged commit 09972e7 into vllm-project:main Feb 12, 2025
46 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
force-merge quantization ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants